<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        /* 1.变量声明提升
              *通过var定义的变量，在赋值之前就能访问到
              *值：undefined
           2.函数声明提升
              *通过function声明的函数，在声明之前就可以调用
        */
        var a = 3;
        fun();
        // undefined
        function fun (){
            console.log(a);
            var a = 4;
        }
    </script>
</head>
<body>
    
</body>
</html>